#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>
#include<QMouseEvent>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);
    ~MusicSlider();
    void setProcessIndex();
    void setProcessBarByTime(double ration);
protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent*event);
signals:
    void processBarPosition(double ration);
private:
    Ui::MusicSlider *ui;
    int _currentWidth;
};

#endif // MUSICSLIDER_H
